package cn.edu.sdjzu.xg.eagle.dao;

import cn.edu.sdjzu.xg.eagle.entity.School;
import cn.edu.sdjzu.xg.eagle.exception.BaseException;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Collection;

/**
 * @author tg.si@188.com
 * @project xg22
 * @date 2024/3/26
 */
public interface SchoolDaoInterface {
    /**
     * 返回id对应的School对象
     *
     * @param id 对象对应的id
     * @return School对象
     * @throws SQLException
     */
    School findById(Long id, Connection connection) throws SQLException, BaseException;

    /**
     * 返回某页上的School对象
     * @param pagination 分页对象(页号, 每页面对象数)
     * @return School对象集合
     * @throws SQLException
     */
//    Collection<School> findAll(Pagination pagination) throws SQLException, BaseException ;

    /**
     * 返回School所有对象
     * @return School对象集合
     * @throws SQLException
     */
    Collection<School> findAll(Connection connection) throws SQLException, BaseException;

//    public Collection<School> findAll(Pagination pagination, List<Condition> conditionList)
//            throws SQLException, BaseException;

    boolean delete(Long id, Connection connection) throws SQLException;
    boolean update(School school, Connection connection) throws SQLException;
    boolean save(School school, Connection connection) throws SQLException;
    boolean delete(School school, Connection connection) throws SQLException;
}